#ifndef __STEPPER_H
#define __STEPPER_H

#include <stdint.h>
#include <stdbool.h>
#include "mcu_param.h"
#include "stepper_param.h"

#define STEPPER_DIR_CLKWISE 0U
#define STEPPER_DIR_ANTICLKWISE 1U
#define STEPPER_EN_ENABLE
#define STEPPER_EN_DISABLE
#define STEPPER_STATE_STOP  0U
#define STEPPER_STATE_RUN   1U

typedef void (*posCallBack)(float);
extern posCallBack x_position_callback, y_position_callback, z_position_callback;

void stepper_dir(uint8_t stepper_index, uint8_t dir);
void stepper_en(uint8_t stepper_index, uint8_t en);
void stepper_pwm_state(uint8_t stepper_index, uint8_t state);
void stepper_pwm_freq_byARR(uint8_t stepper_index, uint16_t ARR_val);
void stepper_make_steps(uint8_t stepper_index, uint32_t step_num);
void stepper_get_steps(uint8_t stepper_index, uint32_t *step_num)

#endif